package com.kfm.base.collection;

import com.kfm.base.movie.Student;

import java.util.HashSet;

public class Demo08 {

    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<>();

        set.add(new Student("张三", 20));
        set.add(new Student("李四", 22));
        set.add(new Student("王五", 21));
        set.add(new Student("王五", 21));

        System.out.println(set.size()); // 3
        System.out.println(set);

//        Student[] stus = set.toArray(new Student[]{});
    }
}
